
#include <iostream>
#include <string>
#include <vector>
#include "ifms_client.h"
using namespace OHOS::FileManagerService;
int main(int argc, char* argv[])
{
    IFmsClient* fmsClient = nullptr;
    fmsClient = IFmsClient::GetFmsInstance();
    if (fmsClient == nullptr) {
        std::cout << "get fmsClient fails." << std::endl;
        return 0;
    }
    std::vector<FileInfo> fileRes;
    std::string path("/data/media");
    std::string type("file");
    int offset = 10;
    int count = 66;
    int err = fmsClient->ListFile(type, path, offset, count, fileRes);
    std::cout << "FileInfo count:" << fileRes.size() << ",err" << err << std::endl;
    for (auto file : fileRes) {
        std::cout << "--------------> FileInfo <--------------" << std::endl;
        std::cout << "file path:" << file.GetPath();
        std::cout << ",file name:" << file.GetName();
        std::cout << ",file type:" << file.GetType();
        std::cout << ",file size:" << file.GetSize();
        std::cout << ",file added time:" << file.GetAddedTime();
        std::cout << ",file modifed time:" << file.GetModifiedTime() << std::endl;
    }
    return 0;
}